use rstest::rstest;

use super::super::*;

#[rstest]
fn test_vacancy_policy_raw_initialization(
    #[values(
        VacancyPolicy::Avoid,
        VacancyPolicy::AvoidStrict,
        VacancyPolicy::Ignore
    )]
    vacancy_policy: VacancyPolicy,
) {
    match vacancy_policy {
        // The following match will fail if the variant is missing or is not a unit variant.
        VacancyPolicy::Avoid | VacancyPolicy::AvoidStrict | VacancyPolicy::Ignore => (),
    }
}

#[rstest]
#[case::avoid(VacancyPolicy::Avoid, "avoid".to_string())]
#[case::avoid(VacancyPolicy::AvoidStrict, "avoid-strict".to_string())]
#[case::exit(VacancyPolicy::Ignore, "ignore".to_string())]
fn test_vacancy_policy_fmt(#[case] vacancy_policy: VacancyPolicy, #[case] expected_output: String) {
    assert_eq!(vacancy_policy.to_string(), expected_output);
}
